#!usr/bin/node

const Dog = require("./05-dog.js");

const jingba = new Dog("jingba",8);
const taidi = new Dog("taidi",5);

jingba.on("bark",onbark);
taidi.on("bark",onbark);

function onbark(e) {
  console.log(`${e.name} ${e.energy}`);
}
